package com.kohler.blog.base.validator.constraint;

import com.kohler.blog.base.validator.annotation.IntegerNotNull;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * 判断 Integer 是否为空【校验器】
 *
 */
public class IntegerValidator implements ConstraintValidator<IntegerNotNull, Integer> {
    @Override
    public void initialize(IntegerNotNull constraintAnnotation) {

    }

    @Override
    public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {

        return value != null;
    }
}
